<%--
  Created by IntelliJ IDEA.
  User: 40937
  Date: 2022/8/18
  Time: 19:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page isELIgnored="false" pageEncoding="utf-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title>订单信息</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/pintuer.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/admin.css">
    <script src="${pageContext.request.contextPath}/js/jquery.js"></script>
    <script src="${pageContext.request.contextPath}/js/pintuer.js"></script>
</head>
<body>


<form method="post" action="#" id="listform">
    <div class="panel admin-panel">
        <div class="panel-head"><strong class="icon-reorder"> 所有订单</strong>



            <table class="table table-hover text-center">
                <tr>
                    <th width="100" style="text-align:left; padding-left:20px;">订单编号</th>
                    <th>用户</th>
                    <th>订单总金额</th>
                    <th>订单状态</th>
                    <th>操作</th>
                </tr>
                <volist name="list" id="vo">
                    <c:forEach items="${orders}" var="order">
                        <tr>
                            <td style="text-align:left; padding-left:20px;"><input type="checkbox" name="id[]" value="" />${order.ID} </td>
                            <td>${order.user.name}</td>
                            <td>${order.totalMoney}</td>
                            <td><c:if test="${order.status == 0}">已结算</c:if>
                                <c:if test="${order.status == 1}">未结算</c:if></td>

                            <td><div class="button-group"> <a class="button border-main" href="${pageContext.request.contextPath}/order/queryByIdOrder?ID=${order.ID}"><span class="icon-edit"></span> 订单详情</a></div></td>
                        </tr>
                    </c:forEach>



                    <tr>
                        <td style="text-align:left; padding:19px 0;padding-left:20px;"><input type="checkbox" id="checkall"/>
                            全选 </td>
                        <td></td>
                    </tr>
                    <tr>
                        <td colspan="8">
                            <div class="pagelist">
                                <span>共几页</span>
                                <a href="">上一页</a>
                                <span class="current">1</span>
                                <a href="">2</a>
                                <a href="">3</a>
                                <a href="">下一页</a>
                                <a href="">尾页</a>
                            </div>
                        </td>
                    </tr>
            </table>
        </div>
    </div>
</form>
<script type="text/javascript">

    //单个删除
    function del(id,mid,iscid){
        if(confirm("您确定要删除吗?")){

        }
    }

    //全选
    $("#checkall").click(function(){
        $("input[name='id[]']").each(function(){
            if (this.checked) {
                this.checked = false;
            }
            else {
                this.checked = true;
            }
        });
    })

    //批量删除
    function DelSelect(){
        var Checkbox=false;
        $("input[name='id[]']").each(function(){
            if (this.checked==true) {
                Checkbox=true;
            }
        });
        if (Checkbox){
            var t=confirm("您确认要删除选中的内容吗？");
            if (t==false) return false;
            $("#listform").submit();
        }
        else{
            alert("请选择您要删除的内容!");
            return false;
        }
    }

</script>
</body>
</html>